﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using BusinessLayer.RegInfo.Entities;
using DBHelper;

namespace BusinessLayer.RegInfo
{
    public class TB_Marketing_DetailBL
    {
        public TB_Marketing_Detail GetTopMarketingDetailByMarketingId(int marketingId)
        {
            TB_Marketing_Detail result = new TB_Marketing_Detail();

            var adapter = new BaseDAO(DbConfig.DbRegInfoConnectionString);
            adapter.AddParameter("@MarketingId", marketingId);
            try
            {
                result = adapter.GetList<TB_Marketing_Detail>("sp_TB_Marketing_Detail_GetTopMarketingDetailByMarketingId", CommandType.StoredProcedure, CustomConnectionState.CloseOnExit).FirstOrDefault();
            }
            catch (Exception)
            {
            }
            finally { adapter.Dispose(); }
            return result;
        }
    }
}
